#pragma once
#include "PinBaseListener.h"

class BlockListener:public PinBaseListener
{
	virtual void enterBlock(PinParser::BlockContext* ctx);
	virtual void exitBlock(PinParser::BlockContext* ctx);

	virtual void enterFunction(PinParser::FunctionContext* /*ctx*/) override;
	virtual void exitFunction(PinParser::FunctionContext* /*ctx*/) override;

	virtual void enterProgram(PinParser::ProgramContext* /*ctx*/) override;
    virtual void enterDefglobal(PinParser::DefglobalContext * /*ctx*/) override;
	virtual void exitDefglobal(PinParser::DefglobalContext* /*ctx*/) override;

    //virtual void enterUnknown(PinParser::UnknownContext * /*ctx*/) override;
	virtual void enterStatement(PinParser::StatementContext* /*ctx*/) override;
    virtual void enterDeclareStruct(PinParser::DeclareStructContext * /*ctx*/) override;

    void errorValidState(antlr4::ParserRuleContext* ctx);

private:

	//void traverse(antlr4::ParserRuleContext* node);
public:
	antlr4::CommonTokenStream* tokens = nullptr;

	int isInBlock = 0;
    int gloablTimes = 0;
};

